package org.eenie.dagger2;

import android.app.Application;

import org.eenie.dagger2.injector.components.AppComponent;
import org.eenie.dagger2.injector.components.DaggerAppComponent;
import org.eenie.dagger2.injector.modules.AppModule;


/**
 * Created by Eenie on 2017/5/3.
 * Email: eeniework@gmail.com
 * Des:
 */

public class App extends Application {

    private AppComponent mAppComponent;

    @Override
    public void onCreate() {
        super.onCreate();
        initAppComponent();

    }

    private void initAppComponent() {
        mAppComponent = DaggerAppComponent
                .builder()
                .appModule(new AppModule(this))
                .build();
        mAppComponent.inject(this);
    }

    public AppComponent getAppComponent() {
        return mAppComponent;
    }
}
